<!DOCTYPE html>
<html lang="cn">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="chapter" content="bp">

  <!-- For Facebook Sharing -->
  <meta property="og:url" content="http://students.brown.edu/seeing-theory/basic-probability/" />
  <meta property="og:type" content="article" />
  <meta property="og:title" content="基础概率论" />
  <meta property="og:description" content="本章将介绍概率论的一些基本概念" />
  <meta property="og:image" content="http://students.brown.edu/seeing-theory/img/share/1.png" />
  <meta property="og:image:width" content="1200" />
  <meta property="og:image:height" content="630" />

  <title>看见统计 - 基础概率论</title>
  <!-- CSS Imports -->
  <!--Fonts-->
  <link href="https://fonts.font.im/css?family=Assistant:300,400,600,700" rel="stylesheet">
  <!--Font Awesome-->
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <!--Favicon-->
  <link rel="shortcut icon" type="image/png" href="../img/favicon.png" />
  <!-- General Chapter -->
  <link rel="stylesheet" type="text/css" href="../css/chapter-style.css">
  <!-- Specific Chapter -->
  <link rel="stylesheet" type="text/css" href="basic-probability.css">
  <!-- JavaScript Imports -->
  <!-- D3 -->
  <script src="../js/d3.min.js"></script>
  <!-- Jquery -->
  <script src="../js/jquery.min.js"></script>
  <script src="../js/jquery-ui.js"></script>
  <!-- jstat -->
  <script src="../js/jstat.min.js"></script>
  <!-- MathJax -->
  <script type="text/javascript" async
    src="https://cdnjs.loli.net/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
  <!-- Tool Tip -->
  <script src="../js/d3.tip.v0.6.3.js"></script>
  <!-- General Chapter -->
  <script src="../js/chapter.js"></script>
  <!-- Visualizations -->
  <script src="basic-probability.js"></script>

</head>

<body id='1'>
  <div id="share-modal"></div>
  <div class="header">
    <div class="progress-bar">
      <div class="progress-bar-color"></div>
    </div>
    <div class="header-wrapper">
      <ul class="chapter-nav">
        <li>
          <span onclick="openNav()" id="hamburger">&#9776; </span>
        </li>
        <li><a href="../cn.html" id="seeing-theory">看见统计</a></li>
        <li><a onclick='toTop()' id='display-chapter'>第一章：基础概率论</a></li>
      </ul>
    </div>
  </div>
  <div class="col-left">
    <div class="col-left-wrapper">
      <div id="section0">
        <div class="chapter-intro">
          <h4>第一章</h4>
          <h1>基础概率论</h1>
          <p>本章将介绍概率论的一些基本概念
          </p>
        </div>
        <div class="scroll-down"> <img src="../img/button/bottom-arrow.svg"></div>
      </div>
      <div id="section1">
        <div class="unit">
          <h3>概率事件</h3>
          <p>

            生活中充满了随机性。概率论是一门用数学语言来刻画这些随机事件的学科。一个随机事件的概率是一个介于0与1之间的实数，这个实数的大小反映了这个事件发生的可能性。因此，概率为0意味着这个事件不可能发生（不可能事件），概率为1意味着这个事件必然发生（必然事件）。
          </p>
          <p>
            以一个投掷一枚公平的硬币（出现正面和反面的概率相等，均为1/2）的经典的概率实验为例：。在现实中，如果我们重复抛一枚硬币，出现正面的频率可能不会恰好是50%。但是当抛硬币的次数增加时，出现正面的概率会越来越接近50%。
          </p>
          <div class="interactive-wrapper">
            <div id="coinWrapper">
              <div id="coin"></div>
              <div id="coinButtons">
                <div class="button-1" id="flipOne">抛一次硬币</div>
                <div class="button-1" id="flipHundred">抛100次硬币</div>
              </div>
            </div>
          </div>
          <p> 如果硬币两面的重量不一样， 出现正面的概率就和出现反面的概率不一样了。上下拖动屏幕右侧<span
              class="blue-color">蓝色</span>柱状图来改变硬币正面和反面的的重量分布。如果我们用一个实数来代表抛硬币的结果：比如说1表示正面，0表示反面，那么我们称这个数为
            <a href="../probability-distributions/cn.html#section1">随机变量</a>。
          </p>
        </div>
      </div>
      <div id="section2">
        <div class="unit">
          <h3>期望</h3>
          <p>一个随机变量的期望刻画的是这个随机变量的概率分布的“中心”。简而言之，当有无穷多来自同一个概率分布的独立样本时，它们的平均值就是期望。数学上对期望的定义是以概率（或密度）为权重的加权平均值。</p>
          <span id="centered">$$\text{E}[X] = \sum_{x \in \mathcal{X}}xP(x)$$</span>
          <p>现在以另一个经典的概率实验为例：扔一枚公平的骰子，每一面出现的概率相等，均为1/6。当试验的次数越来越多时，扔出的结果的平均值慢慢趋向于它的期望3.5。</p>
          <div class="interactive-wrapper">
            <div id="dieWrapper">
              <div id="die"></div>
              <div id="dieButtons">
                <div class="button-1" id="rollOne">扔一次骰子</div>
                <div class="button-1" id="rollHundred">扔100次骰子</div>
              </div>
            </div>
          </div>
          <p>上下拖动下方<span class="blue-color">蓝色</span>概率条改变骰子每一面的重量分布（把骰子变的不公平）并观察期望是如何被影响的。</p>
          <div id="barDie"></div>
        </div>
      </div>
      <div id="section3">
        <div class="unit">
          <h3>方差</h3>
          <p>如果说随机变量的期望刻画了它的概率分布的“中心”，那么方差则刻画了概率分布的分散度。方差的定义是一个随机变量与它的期望之间的差的平方的加权平均值。这里的权重仍然是概率（或者密度）。</p>
          <span id="left-mathjax">$$\text{Var}(X) = \text{E}[(X - \text{E}[X])^2]$$</span>
          <p>随机从下面十张牌中抽牌。当抽取的次数越来越多时，可以观察到样本平方差的平均值（<span class="green-color">绿色</span>）逐渐趋向于它的方差（<span
              class="blue-color">蓝色</span>）。</p>
          <div class="interactive-wrapper">
            <div id="cardWrapper">
              <div id="card"></div>
              <div id="cardButtons">
                <div class="button-1" id="drawOne">抽一次牌</div>
                <div class="button-1" id="drawHundred">抽100次牌</div>
              </div>
            </div>
          </div>
          <p>点选下面的牌来选择抽取实验用的一副牌。</p>
          <div class="interactive-wrapper">
            </br>
            <input type="checkbox" class="deck" id="card_one" value="1">
            <label for="card_one"></label>
            <input type="checkbox" class="deck" id="card_two" value="2">
            <label for="card_two"></label>
            <input type="checkbox" class="deck" id="card_three" value="3">
            <label for="card_three"></label>
            <input type="checkbox" class="deck" id="card_four" value="4">
            <label for="card_four"></label>
            <input type="checkbox" class="deck" id="card_five" value="5">
            <label for="card_five"></label>
            <input type="checkbox" class="deck" id="card_six" value="6">
            <label for="card_six"></label>
            <input type="checkbox" class="deck" id="card_seven" value="7">
            <label for="card_seven"></label>
            <input type="checkbox" class="deck" id="card_eight" value="8">
            <label for="card_eight"></label>
            <input type="checkbox" class="deck" id="card_nine" value="9">
            <label for="card_nine"></label>
            <input type="checkbox" class="deck" id="card_ten" value="10">
            <label for="card_ten"></label>
          </div>
        </div>
      </div>
    </div>
    <div class="action-buttons">

      <ul>
        <a href="../doc/basic-probability.pdf">
          <li><i class="fa fa-file-text-o action-icon" aria-hidden="true"></i> <span>下载英文PDF</span></li>
        </a>
        <a id="share-button" class="inline-share">

          <li><i class="fa fa-share-square-o action-icon" aria-hidden="true "></i>分享</li>
          <li>
            <div id="share" data-sites="weibo,qq,douban,wechat, facebook, twitter, google,linkedin"></div>
          </li>
          <li>
            <div id="share-modal"></div>
          </li>

        </a>

      </ul>
    </div>
    <a href="../compound-probability/cn.html">
      <div class="chapter-footer" id="next-chapter-color">
        <div class="chapter-footer-wrapper">
          <h4>下一章</h4>
          <p id='next-chapter'>进阶概率论 → </p>
        </div>
      </div>
    </a>
  </div>
  <div class="col-right">
    <div class='language-setting'>
      <select class="languageSetting">
        <option selected>中文</option>
        <option data-url="index.html">English</option>
        <option data-url="es.html">Español</option>
      </select>
    </div>
    <div class="nav-section" id="section-0">
      <div class="nav-unit-wrapper" id='one'>
        <img src="../img/tiles/1-1.png">
        <span class="nav-unit-title"> 随机事件 </span>
      </div>
      <div class="nav-unit-wrapper" id='two'>
        <img src="../img/tiles/1-2.png">
        <span class="nav-unit-title"> 期望 </span>
      </div>
      <div class="nav-unit-wrapper" id='three'>
        <img src="../img/tiles/1-3.png">
        <span class="nav-unit-title"> 方差 </span>
      </div>
    </div>
    <div class="visualization-section" id="section-1">
      <div class="visualization-wrapper" id="barCoin"></div>
    </div>
    <div class="visualization-section" id="section-2">
      <div class="visualization-wrapper" id="plotDie"></div>
    </div>
    <div class="visualization-section" id="section-3">
      <div class="visualization-wrapper" id="varSvg"></div>
    </div>
  </div>
  <div id="overlay">
    <div class="modal-header">
      <div class="closebtn" onclick="closeNav()">&times;</div>
      <ul>
        <li>
          <select class="languageSetting">
            <option selected>中文</option>
            <option data-url="index.html">English</option>
            <option data-url="es.html">Español</option>
          </select>
        </li>
        <li><a href="../cn.html">首页</a></li>
      </ul>
    </div>
    <div class="modal-wrapper">
      <div class="modal-chapter">
        <div id="chapter-text"><span>章节</span></div>
        <ul class="modal-chapter-titles">
          <li id="bp-li" class="chapter-highlighted">基础概率论</li>
          <li id="cp-li">进阶概率论</li>
          <li id="pd-li">概率分布</li>
          <li id="fi-li">统计推断：频率学派</li>
          <li id="bi-li">统计推断：贝叶斯学派</li>
          <li id="ra-li">回归分析</li>
        </ul>
      </div>
      <div class="modal-visualization">
        <div id="bp" class="current">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/1-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 随机事件 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/1-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 期望 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/1-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 方差 </span>
          </div>
        </div>
        <div id="cp">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/2-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 集合论 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/2-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 古典概型 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/2-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 条件概率 </span>
          </div>
        </div>
        <div id="pd">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/3-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 随机变量 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/3-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 离散型和连续型随机变量 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/3-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 中心极限定理 </span>
          </div>
        </div>
        <div id="fi">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/4-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 点估计理论 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/4-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 置信区间 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/4-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> Bootstrap方法 </span>
          </div>
        </div>
        <div id="bi">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/5-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 贝叶斯公式 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/5-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 似然函数 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/5-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 从先验概率到后验概率 </span>
          </div>
        </div>
        <div id="ra">
          <div class="nav-unit-wrapper-s tile1">
            <img src="../img/tiles/6-1.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 最小二乘法 </span>
          </div>
          <div class="nav-unit-wrapper-s tile2">
            <img src="../img/tiles/6-2.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 相关性 </span>
          </div>
          <div class="nav-unit-wrapper-s tile3">
            <img src="../img/tiles/6-3.png" class="nav-unit-tile-s">
            <span class="nav-unit-title-s"> 方差分析 </span>
          </div>
        </div>
      </div>
    </div>
  </div>

  <link rel="stylesheet" href="../css/share.min.css">
  <script src="../js/jquery.share.min.js"></script>
  <script>
    $('#share').share();

    $(".languageSetting").change(function() {
      var option = $(this).find('option:selected');
      window.location.href = option.data("url");
    });

  </script>
</body>

</html>
